using System;
using System.Collections.Generic;
using System.Text;

using System.Data;
using System.Data.Common;
using Husb.Data;
using Husb.DataUtil;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Caching;

using CentralOffice.Task.Data;

using ProgressTable = CentralOffice.Task.Data.TaskProgressDataSet.TaskProgressDataTable;
using ProgressRow   = CentralOffice.Task.Data.TaskProgressDataSet.TaskProgressRow;



namespace CentralOffice.Task.DataAccess
{
    public class TaskProgressAdapter : DataAccessAdapter<CentralOffice.Task.Data.TaskProgressDataSet, ProgressTable, ProgressRow>
    {
        public TaskProgressAdapter()
        {
            //this.TableName = "TaskProgress";

            GetAllStoredProc = "Tasks.TaskProgress_SelectTaskProgressesAll";
            InsertStoredProc = "Tasks.TaskProgress_InsertTaskProgres";
            UpdateStoredProc = "Tasks.TaskProgress_UpdateTaskProgres";
            DeleteStoredProc = "Tasks.TaskProgress_DeleteTaskProgres";

            GetByIdStoredProc     = "Tasks.TaskProgress_SelectTaskProgres";
            GetByNameStoredProc   = "";
            GetPagedStoredProc    = "Tasks.TaskProgress_SelectTaskProgressesPaged";
            GetRowCountStoredProc = "Tasks.TaskProgress_SelectTaskProgressesRowCount";

            LogicalDeleteStoredProc = "Tasks.TaskProgress_DeleteTaskProgresLogical";
        }

        protected override void PopulateInsertParameters(Database db, DbCommand cmd)
        {
            db.AddInParameter(cmd, "Id", DbType.Guid, "Id", DataRowVersion.Current);
            db.AddInParameter(cmd, "Name", DbType.String, "Name", DataRowVersion.Current);
            db.AddInParameter(cmd, "Remark", DbType.String, "Remark", DataRowVersion.Current);
            db.AddInParameter(cmd, "TaskId", DbType.Guid, "TaskId", DataRowVersion.Current);
            db.AddInParameter(cmd, "Attachments", DbType.String, "Attachments", DataRowVersion.Current);
            db.AddInParameter(cmd, "IsDeleted", DbType.Boolean, "IsDeleted", DataRowVersion.Current);
            db.AddInParameter(cmd, "IsActive", DbType.Boolean, "IsActive", DataRowVersion.Current);
            db.AddInParameter(cmd, "CreatedTime", DbType.DateTime, "CreatedTime", DataRowVersion.Current);
            db.AddInParameter(cmd, "CreatedBy", DbType.String, "CreatedBy", DataRowVersion.Current);
            db.AddInParameter(cmd, "ModifiedTime", DbType.DateTime, "ModifiedTime", DataRowVersion.Current);
            db.AddInParameter(cmd, "LastModifiedBy", DbType.String, "LastModifiedBy", DataRowVersion.Current);
            db.AddInParameter(cmd, "Version", DbType.Int32, "Version", DataRowVersion.Current);
            db.AddInParameter(cmd, "Description", DbType.String, "Description", DataRowVersion.Current);
        }

        
    }
}
